#include "ProcTable.h"
#include <vector>
#include <iostream>
using namespace std;

	vector<ProcDataRow> ProcTable::table;

	string ProcTable::getName(int index){
		return table.at(index).getName();
	}
	int ProcTable::getIndex(string name){
		ProcDataRow toCheck;
		int index = -1;
		int j = table.size();
		for(int i = 0; i < j; i++){
			toCheck = table.at(i);
			if(toCheck.getName().compare(name)==0){
				index = i;
				break;
			}
		}
		return index;
	}
	int ProcTable::insertData(string name){
		ProcDataRow data;int index = -1;
		if (table.empty() == false)
			index = getIndex(name);
		if(index == -1){
			data.createProcDataRow(name);
			table.push_back(data);
			index = getTableSize()-1;
		}
		return index;
	}
	int ProcTable::getTableSize(){
		return table.size();
	}
	;
